﻿@model IEnumerable<NavigationItem>
@if (this.Model != null && this.Model.Count() > 0)
{
    int idx = 0;
    int total = this.Model.Count();
    <ul>
        @foreach (var item in this.Model)
        {
            if (item.Items != null && item.Items.Count > 0)
            {
                continue;
            }
            if (MenuHelper.CanCurrentUserAccessMenuItem(item))
            {
            <li class="@(idx == 0 ? "first" : "") @(idx == total - 1 ? "last" : "")">
                <a href="@item.Url" @(string.IsNullOrEmpty(item.Target) ? "" : Html.Raw(string.Format("target={0}", item.Target)).ToString()) title="@item.Caption">
                    @if (!string.IsNullOrEmpty(item.ImageUrl))
                    {
                        <img src="@Theme.Image(item.ImageUrl)" alt=""/>
                    }
                    <span>@item.Caption</span> </a></li>
                     idx++;
            }
        }
    </ul>
}
